<?php  

class home extends CI_Controller {
 
	var $limit=10;
	var $offset=10;	
	function index($limit='',$offset=''){	
		$this->load->model("init"); 
		$this->init->getLasturl();
		if($this->session->userdata('LOGIN')=='TRUE'){
		$this->load->model("listpegawai_model"); 
		$data['judul']='Table Pegawai';
		 
		$data['query']=$this->listpegawai_model->getListPegawai();
		$data['view']='pegawai/data_pegawai';
		$this->load->view('index',$data); } else {
		redirect('home/loginPage');		
		}
	}
	function loginPage(){
		$this->load->view('login');
	}
	function loginAct(){
		$this->load->model("user_model");
		$this->user_model->cek();
	}
	function search($limit='',$offset=''){
	 	$this->load->model("listpegawai_model"); 
		 
 
		$data['query']=$this->listpegawai_model->getListPegawai();
		$this->load->view('pegawai/data_pegawai',$data);
	}
	function logout(){
		$this->session->sess_destroy();
		redirect('home/loginPage');		
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */